//
//  TicketUsingTipCell.m
//  ImGuider
//
//  Created by 王鹏宇 on 2017/12/14.
//  Copyright © 2017年 AudioCtrip. All rights reserved.
//

#import "TicketUsingTipCell.h"

@implementation TicketUsingTipCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}


- (void)configDataWithModel:(UploadTicketOrderModel *)model {
    
    self.usingTipLabel.text =  MYLocalizedString(@"TICKET_SCCUSESS_USING_TIP", nil);
    self.usingTimeLabel.text =  MYLocalizedString(@"TICKET_USE_DATE_TIP", nil);
    self.visitdateLabel.text = model.visitdate;
    self.usingWayLabel.text = MYLocalizedString(@"TICKET_USE_TYPE", nil);
    self.ticketWayLabel.text = [self getIntoWayWith:model];
    
    if (model.entityticket.boolValue) {
        self.getTicketLabel.text = [self getTicketWayWith:model];
        self.getingWayLabel.text = MYLocalizedString(@"TICKET_COLLECTION_METHOD_WAY", nil);
        self.getTicketView.hidden = NO;
        self.getTicketViewHeight.constant = 50;
    }else{
        self.getTicketLabel.text = @"";
        self.getingWayLabel.text = @"";
        self.getTicketView.hidden = YES;
        self.getTicketViewHeight.constant = 0;
    }
    
}

- (NSString *)getTicketWayWith:(UploadTicketOrderModel *)model {
    
    if ([model.ticketway isEqualToString:@"passport"]) {
        
        return MYLocalizedString(@"TICKET_COLLECTION_METHOD_PASSPORT", nil);
    }else{
        return MYLocalizedString(@"TICKET_COLLECTION_METHOD_ETICKET", nil);
    }
    
    return @"";
}

- (NSString *)getIntoWayWith:(UploadTicketOrderModel *)model {
    
    
    if ([model.ticketway isEqualToString:@"passport"]) {
        
        return MYLocalizedString(@"TICKET_USE_TYPE_PASSPORT", nil);
    }else{
        return MYLocalizedString(@"TICKET_USE_TYPE_ETICKET", nil);
    }
    
    return @"";
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
